package cn.dhnep.demo.service.impl;

import cn.dhnep.demo.mapper.SfOrderMapper;
import cn.dhnep.demo.pojo.entity.SfOrder;
import cn.dhnep.demo.service.SfOrderService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author 邱文彬
 * @Date 2021/11/12 9:26
 * @Version 1.0
 */


@Service
public class SfOrderServiceImpl implements SfOrderService {




    @Autowired
    private SfOrderMapper sfOrderMapper;



    @Override
    public List<SfOrder> querySfOrder(int row , int page) {


        PageHelper.startPage(row,page);
        List<SfOrder> sfOrder = sfOrderMapper.selectAll();

        PageInfo<SfOrder> pi = new PageInfo<>(sfOrder);

return pi.getList();

    }

    @Override
    public SfOrder querySfOrderByOrderId(String orderId) {
        SfOrder sfOrder = sfOrderMapper.selectAllByOrderId(orderId);
        return sfOrder;
    }

    @Override
    public SfOrder querySfOrderByPhone(String sendTel) {
        SfOrder sfOrder = sfOrderMapper.selectAllByPhone(sendTel);
        return sfOrder;
    }
}
